package com.bifrost.service;

import com.bifrost.entity.Customer;
import com.bifrost.entity.MerchantStore;
import com.bifrost.common.model.ResultModel;
import com.bifrost.model.cart.CartResult;

import java.util.List;

/**
 * @author rangjf
 * @date 2017/11/6
 */
public interface ShoppingCartService {

    /**
     * 加入购物车
     *
     * @param customer
     * @param skuId
     * @param quantity
     * @param hasService        是否有服务
     * @param skuServicePriceId skuServicePriceId
     * @param serviceMerchantId 服务门店Id
     * @return Map
     */
    public ResultModel addToCarts(Customer customer, Long skuId, Long quantity,
                                  String hasService, String skuServicePriceId, Long serviceMerchantId);

    /**
     * 加入购物车
     *
     * @param store
     * @param customer
     * @param skuId
     * @param quantity
     * @return
     */
    public ResultModel addToCartsByStore(MerchantStore store, Customer customer, Long skuId, Long quantity);

    /**
     * 获取购物车数量
     *
     * @param customer 实体
     * @return
     */
    public Long getCartsQuantity(Customer customer);

    /**
     * 获取购物车数量
     *
     * @param store
     * @param customer
     * @return
     */
    public Long getCartsQuantityByStore(MerchantStore store, Customer customer);

    /**
     * 获取购物车信息
     *
     * @param customer customer
     * @return Map
     */
    public List<CartResult> getCarts(Customer customer);

    /**
     * 获取购物车信息
     * 仅用于重百商城：返回List size <= 1
     *
     * @param customer
     * @param store
     * @return
     */
    public List<CartResult> getCartsByStore(Customer customer, MerchantStore store);

    /**
     * 修改购物车
     *
     * @param customer
     * @param store
     * @param cartItemId
     * @param quantity   购物车商品数量
     * @return
     */
    public boolean updateCarts(Customer customer, MerchantStore store, Long cartItemId, Long quantity);

    /**
     * 移除购物车
     *
     * @param customer
     * @param store
     * @param cartItemIds 购物车itemIds数组
     * @return
     */
    public boolean deleteCarts(Customer customer, MerchantStore store, String[] cartItemIds);

    /**
     * 删除购物车中指定商品
     *
     * @param customer
     * @param store
     * @param cartId
     * @param skus
     * @return
     */
    public boolean deleteSkusByCart(Customer customer, MerchantStore store, Long cartId, List<Long> skus);
}
